package zj.xinxin.api.moudle.article.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author junzhou
 * @date 2022/4/12 18:52
 * @since 1.8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ArticleDto implements Serializable {
    private Long articleId;

    @ApiModelProperty(value = "发布日期")
    // 后台到前台
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    // 前台到后台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime pushData;

    @ApiModelProperty(value = "发表用户")
    private String articleUser;

    @ApiModelProperty(value = "博文标题")
    private String title;

    @ApiModelProperty(value = "点赞数")
    private Integer likeCount;

    @ApiModelProperty(value = "评论数")
    private Integer commentCount;

    @ApiModelProperty(value = "浏览量")
    private Integer readCount;

    @ApiModelProperty(value = "是否置顶")
    private String topFlag;

    @ApiModelProperty(value = "创建时间")
    // 后台到前台
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    // 前台到后台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "文章摘要")
    private String articleSummary;

    @ApiModelProperty(value = "文章markdown内容")
    private String contentMd;

    @ApiModelProperty(value = "文章html内容")
    private String contentHtml;

    @ApiModelProperty(value = "删除标识（0 正常。1 删除）")
    private Boolean delFlag;

    @ApiModelProperty(value = "创建者")
    private String createBy;

    @ApiModelProperty(value = "创建日志")
    // 后台到前台
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    // 前台到后台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改者")
    private String updateBy;

    @ApiModelProperty(value = "修改时间")
    // 后台到前台
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    // 前台到后台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtUpdate;

    @ApiModelProperty(value = "文章类别")
    private CategoryDto category;

    @ApiModelProperty(value = "文章标签信息")
    private List<TagDto> tagList;
}
